package cs4game;

public class Vector3D implements Comparable<Vector3D>{
	//Convienence class to make thinking about points easier
	float x, y, z;
	public Vector3D(float xC, float yC, float zC){
		x = xC;
		y = yC;
		z = zC;
	}
	
	public Vector3D(double xC, double yC, double zC) {
		this((float)xC, (float)yC, (float)zC);
	}

	//Only returns 0 if the three coordinate values are equal
	public int compareTo(Vector3D p2){
		if(x == p2.x && y == p2.y && z == p2.z)
			return 0;
		if(x != p2.x)
			return (int) (p2.x-x);
		if(y != p2.y)
			return (int) (p2.y-y);
		if(z != p2.z)
			return (int) (p2.z-z);
		return -1;
	}
	
	public boolean equals(Vector3D p2){
		return (x == p2.x && y == p2.y && z == p2.z);
	}
	
	public String toString(){
		return "("+x+", "+y+", "+z+")";
	}

	public Vector3D copy() {
		return new Vector3D(x,y,z);
	}
}

	
